<template>
  <div class="form-single-fragment" style="position: relative">
    <el-form
      :model="detailData"
      label-width="120px"
      size="mini"
      label-position="right"
    >
      <el-row :gutter="20">
        <el-col :span="12">
          <el-form-item label="单位名称：">{{
            detailData.custName
          }}</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="客户层级：">{{
            detailData.custLevelName
          }}</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="单位属性：">{{
            detailData.unitAttributeName
          }}</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="客户地区：">{{
            detailData.districtName
          }}</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="企业联系人：">{{
            detailData.contacts
          }}</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="联系电话：">{{
            detailData.telephone
          }}</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="客户职务：">{{
            detailData.custPosition
          }}</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="客户生日：">{{
            detailData.custBirthday
          }}</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="客户兴趣：">{{
            detailData.custInterest
          }}</el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="维护周期：">{{
            detailData.maintainCycle
          }}</el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="主要社会关系：">{{
            detailData.mainSocialRelations
          }}</el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<script>
import { Customers } from '@/api/commercial.js';
export default {
  name: 'Customeradd',
  props: {
    customerId: {
      default: undefined
    }
  },
  data () {
    return {
      loading: false,
      isShowloading: false,
      detailData: {}
    };
  },
  created () {},
  computed: {
    isEdit () {
      return this.customerId != null && this.customerId !== '';
    }
  },
  mounted () {
    this.loadCustomerdetail();
  },
  methods: {
    /**
     * 客户详情
     */
    loadCustomerdetail () {
      let params = this.customerId;
      return new Promise((resolve, reject) => {
        Customers.detail(this, params)
          .then((res) => {
            this.detailData = res.data;
          })
          .catch((e) => {
            reject(e);
          });
      });
    }
  }
};
</script>
